package com.wlyuan.index.api.waybill.dto.waybill;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author yuanjie
 */
@Data
public class WaybillVehicleDTO implements Serializable {

    @ApiModelProperty(value = "车型类型(1-11)", required = true, allowableValues = "range[1,11]")
    @Range(min = 1, max = 11, message = "车型不存在")
    @NotNull(message = "车型不能为空")
    private Long model;

    @ApiModelProperty(value = "车长")
    @NotNull(message = "车长不能为空")
    private Double length;

    @ApiModelProperty(value = "载重(2位整数，4位小数)")
    @Digits(integer = 2, fraction = 4, message = "载重最多可输入2位整数，4位小数")
    private BigDecimal weight;

    @ApiModelProperty(value = "体积(3位整数，6位小数)")
    @Digits(integer = 3, fraction = 6, message = "体积最多可输入3位整数，6位小数")
    private BigDecimal volume;

    @Range(min = 1, max = 10, message = "整车数量为1-10的整数")
    @ApiModelProperty(value = "整车数量(1-10)", allowableValues = "range[1,10]")
    private Integer quantity;
}
